﻿using System.Collections.ObjectModel;

namespace Microsoft.Xna.Framework.Media
{
	/// <summary>
	/// Encapsulates visualization (frequency and sample) data for the currently-playing song.
	/// </summary>
	public class VisualizationData
	{
		#region Fields
		internal float[] frequencies;
		private ReadOnlyCollection<float> frequenciesCollection;
		internal float[] samples;
		private ReadOnlyCollection<float> samplesCollection;
		#endregion

		#region Properties
		/// <summary>
		/// Returns a collection of floats that contain frequency data.
		/// </summary>
		public ReadOnlyCollection<float> Frequencies
		{
			get { return frequenciesCollection; }
		}

		/// <summary>
		/// Returns a collection of floats that contain sample data.
		/// </summary>
		public ReadOnlyCollection<float> Samples
		{
			get { return samplesCollection; }
		}
		#endregion

		#region Constructor
		/// <summary>
		/// Initializes a new instance of the VisualizationData class.
		/// </summary>
		public VisualizationData()
		{
			this.frequencies = new float[0x100];
			this.samples = new float[0x100];
			this.frequenciesCollection = new ReadOnlyCollection<float>(this.frequencies);
			this.samplesCollection = new ReadOnlyCollection<float>(this.samples);
		}
		#endregion
	}
}
